Skip to content

Conversation

@bomoko
Copy link
Contributor

@bomoko bomoko commented Oct 23, 2025

This PR introduces two things.

First, the API exposes a new set of data on the environments - namely, whether they have any pendingChanges.
These are simple, {type:,details} messages that indicate that there are pending changes to an environment (with the implication being that a redeploy is necessary).

Secondly - it introduces an "updated" field to the environment variables table that keeps track of when the last time an env var was update. This is used to check, against the last deployment, whether or not a redeploy is necessary.

General Checklist

  • Affected Issues have been mentioned in the Closing issues section
  • Documentation has been written/updated
  • PR title is ready for inclusion in changelog

Database Migrations

  • If your PR contains a database migation, it MUST be the latest in date order alphabetically

Description

Explain the details for making this change. What existing problem does the pull request solve?

Closing issues

Put closes #XXXX in your comment to auto-close the issue that your PR fixes (if such).

@bomoko bomoko requested a review from shreddedbacon October 23, 2025 21:15
@bomoko bomoko requested a review from shreddedbacon October 23, 2025 22:57
@shreddedbacon
Copy link
Member

shreddedbacon commented Oct 24, 2025

I'm also wondering if this may need some changes around the state of the last deployment. For example, if it fails for whatever reason before the changes are actually applied by a build, the pending changes would show as none, but not been applied.

Would it be worth selecting the last deployment based on status being complete?

Edit: Now checks deployment status ✔️

@bomoko bomoko requested review from shreddedbacon and removed request for shreddedbacon October 26, 2025 20:54
@github-actions
Copy link

github-actions bot commented Oct 26, 2025

Overview

Image reference testlagoon/api:main lagoon/api:ci-latest
- digest 85e27f36ab1e b377c1af7d61
- tag main ci-latest
- provenance https://github.com/uselagoon/lagoon.git/commit/dc666d20adb834a14b9941b139bd92fdfec01824
- vulnerabilities critical: 8 high: 22 medium: 40 low: 5 critical: 8 high: 22 medium: 40 low: 5
- platform linux/amd64 linux/amd64
- size 145 MB 174 MB (+29 MB)
- packages 1525 1525
Base Image node:22-alpine
also known as:
22-alpine3.22
jod-alpine
jod-alpine3.22
lts-alpine
lts-alpine3.22
node:22-alpine
also known as:
22-alpine3.22
jod-alpine
jod-alpine3.22
lts-alpine
lts-alpine3.22
- vulnerabilities critical: 0 high: 1 medium: 2 low: 2 critical: 0 high: 1 medium: 2 low: 2

Copy link
Member

@shreddedbacon shreddedbacon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all works for me. I haven't fully gone over the SQL query as it is quite a monster.

I ran through a few different scenarios with ordering variable additions etc, and I think there is only one thing that I might change, and that would be that the completed timestamp of the build is probably the wrong one to use, and the created timestamp with the completed status should be used.

The reason being, when the build is created, the data sent to the build contains whatever was in the API at that time. If a variable is added AFTER that build is created, it is considered a pending change still, as the last build wouldn't have known about it.

Copy link
Member

@shreddedbacon shreddedbacon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise this is ✔️ from me

Copy link
Member

@shreddedbacon shreddedbacon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff, this will be super useful to extend in #3990 to show pending route changes too.

@shreddedbacon
Copy link
Member

Change of plan, lets change the type to be enums so we have a way to filter etc

@bomoko bomoko requested a review from shreddedbacon October 27, 2025 22:30
Copy link
Member

@shreddedbacon shreddedbacon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, enum makes a lot of sense here when we consider future pending changes. We can adjust the details section overtime, or even add new fields as necessary as other pending change types appear

Copy link
Member

@shreddedbacon shreddedbacon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥳 Great!

@rocketeerbkw
Copy link
Member

Minimal but extensible addition 🎉

@rocketeerbkw rocketeerbkw merged commit e5a91c9 into main Oct 29, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants